fix(security): phase-1 agent VM harden (keep NAT, defer private cutover)#9261
Draft
Git-on-my-level wants to merge 5 commits into
Draft
fix(security): phase-1 agent VM harden (keep NAT, defer private cutover)#9261Git-on-my-level wants to merge 5 commits into
Git-on-my-level wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5ad7e46dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
4 issues found across 6 files
Confidence score: 2/5
- In
desktop/macos/Backend-Rust/src/routes/agent.rs, removingaccessConfigsmeanscreate_gce_vmcan no longer produce an external IP while itsResult<String>contract and downstream consumers still treat it as reachable over public network; merging as-is is likely to break agent provisioning/reachability flows — either restore external IP assignment or change the return contract and all callers before merging. AGENTS.mddescribesagent-vm-firewallas denying only publictcp:8080, butbackend/charts/agent-vm-firewall/firewall-rule.yamlusessourceRanges: [0.0.0.0/0]on a DENY ingress rule, which effectively blocks that port from everywhere and can cut off intended internal access paths — align the rule or documentation to the intended policy and verify expected traffic still works.backend/scripts/agent-vm-reachability-check.shrelies on Pythonassertfor firewall contract checks, andbackend/scripts/apply-agent-vm-firewall.shvalidates onlyDENYwhile not enforcing full contract fields (like ingress/public source ranges), so CI/deploy validation can silently pass unsafe or incorrect rules in some environments — replaceassertwith explicit runtime checks and enforce all security-critical fields before merging.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Remove ONE_TO_ONE_NAT accessConfigs from GCE insert payload so new agent VMs are private-network only. Add Rust contract test guarding the provision JSON shape. Verification: cd desktop/macos/Backend-Rust && cargo test provision Related #7326 Co-authored-by: Cursor <cursoragent@cursor.com>
Add GCP firewall IaC for tag omi-agent-vm that denies public tcp:8080, with apply/reachability scripts and hermetic contract tests. Extend the Rust provision JSON contract to assert omi-agent-vm tagging and no public IP fields in the insert payload. Verification: cd desktop/macos/Backend-Rust && cargo test provision cd backend && python3 -m pytest tests/unit/test_agent_vm_firewall_contract.py -v backend/scripts/agent-vm-reachability-check.sh Closes #7326 Related #6611 Co-authored-by: Cursor <cursoragent@cursor.com>
f5ad7e4 to
d77624e
Compare
Collaborator
Author
|
Monitor follow-up for PR #9261:
Verification passed:
|
Keep public NAT and tag omi-agent-vm; gate firewall apply as deferred phase-3. Auth-gate VM /health and update desktop + agent-proxy callers. Verification: cargo test agent::contract python3 -m pytest backend/tests/unit/test_agent_vm_firewall_contract.py -v Related #7326 Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase-1, low-blast-radius harden for agent VM public
:8080exposure (#7326) — without removing public NAT or applying a public DENY firewall (those break prod today).Why not private-only yet: agent VMs are on VPC
default;agent-proxyis on GKEomi-prod-vpc-1with no peering. Desktop still callshttp://{vmIP}:8080for upload/sync. Removing NAT or denying0.0.0.0/0would break chat + DB sync.This PR (safe to merge)
ONE_TO_ONE_NAT/ public IP provisioningomi-agent-vmnetwork tag/health(was publicly readabledatabaseReady); update desktop + agent-proxy callersAGENT_VM_FIREWALL_APPLY_PHASE3gate)AGENTS.mddescribing the deferred cutoverExplicitly deferred (do not apply yet)
Related: #6611
Closes: partial progress on #7326 (auth harden + prepare surface; not full network isolation)
Test plan
After merge / deploy (auth path):
desktop/macos/agent-cloud/agent.mjsto the agent GCS artifact bucket (VMs hot-reload from GCS).agent-proxy+ desktop-backend as needed for caller header changes.GET http://<vm-public-ip>:8080/health→401.?token=) →200withdatabaseReady.wss://agent.omi.mestill works.Do not run
apply-agent-vm-firewall.shor--livereachability against prod until PR10c + private reachability land.Merge with a regular merge (no squash).
Made with Cursor